projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1660f79
)
fix rounding error + atan(0,0) instability
author
parkrrrr
<parkrrrr>
Thu, 6 Apr 2006 20:54:33 +0000
(20:54 +0000)
committer
parkrrrr
<parkrrrr>
Thu, 6 Apr 2006 20:54:33 +0000
(20:54 +0000)
garmin_txt.c
patch
|
blob
|
history
diff --git
a/garmin_txt.c
b/garmin_txt.c
index 1be486c645c5ce394e155e5d6b96c24e17f3ed64..b6b19fb9e3571faceaff092c2feba1bd5e9d078c 100644
(file)
--- a/
garmin_txt.c
+++ b/
garmin_txt.c
@@
-296,6
+296,7
@@
course_rad(double lat1, double lon1, double lat2, double lon2)
v1 = sin(lon1 - lon2) * cos(lat2);
v2 = cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(lon1 - lon2);
if (fabs(v2) < 0.000000000000001) v2 = 0.0; /* fix calculation diff. between 32- and 64-bit systems */
+ if (fabs(v1) < 0.000000000000001) v1 = 0.0; /* fix calculation diff. between 32- and 64-bit systems */
return atan2(v1, v2);
}